package com.sloera.springcloud.payment.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author sloera
 * @since 2020-08-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("payment")
public class Payment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(notes = "id.", example = "2", position = 1)
    private Long id;

    @TableField("serial")
    @NotBlank
    @Size(min = 1, max = 30)
    @Pattern(regexp = "\\d")
    private String serial;

    @TableField("age")
    @Min(0)
    @Max(120)
    private int age;

    @TableField("create_time")
    private LocalDateTime createTime;

    @Getter
    @AllArgsConstructor
    public enum temp {
        /**
         * 星期一
         */
        Monday(1, "星期一");
        private Integer code;
        private String msg;
    }

}
